import React, { Component } from 'react'
import { Badge, Button, Switch } from 'antd';
import { MinusOutlined, PlusOutlined, QuestionOutlined } from '@ant-design/icons';

const ButtonGroup = Button.Group;

export default class Wei extends Component {
    state = {
        count: 5, 
         cun:45,
        show: true,
      
    };

    increase = () => {
        const count = this.state.count + 1;
        this.setState({ count });
    };

    decline = () => {
        let count = this.state.count - 1;
        if (count < 0) {
            count = 0;
        }
        this.setState({ count });
    };

    random = () => {
        const count = Math.floor(Math.random() * 100);
        this.setState({ count });
    };

    increase2 = () => {
        const cun = this.state.cun + 45;
        this.setState({ cun });
    };

  

    render() {
        return (
            <div>
                <div>

                    <ButtonGroup>


                        <Button onClick={this.decline}>
                            <MinusOutlined />
                        </Button>



                        <Badge count={this.state.count}>
                            <a href="#" className="head-example" />
                        </Badge>
                        

                        <Badge cun={this.state.cun}>
                            <a href="#" className="head-example" />
                        </Badge>

                        <Button onClick={this.increase2}>
                            <PlusOutlined />
                        </Button>




                        <Button onClick={this.increase}>
                            <PlusOutlined />
                        </Button>


                        <Button onClick={this.random}>
                            <QuestionOutlined />
                        </Button>

                    </ButtonGroup>
                </div>
              
            </div>
        );
    }
}
